package com.mryang.ladder;

import java.util.Scanner;

/**
 * @ClassName L1_013
 * @Description TODO 对于给定的正整数N，需要你计算 S=1!+2!+3!+...+N!。
 * @Author Genius
 * @Date 2021/1/25 22:42
 */
public class L1_013 {
    public static void main(String[] args) {
        int number = new Scanner(System.in).nextInt();
        int count = 0;
        for (int i = 1; i <= number; i++) { // 3
            int num = 1;
            for (int j = i; j > 0; j--) {
                num = num*j;
            }
            count = count + num;
        }
        System.out.println(count);
    }
}
